<?php 
require dirname ( __FILE__ ) . '/lib/init.php';

$oid = intval($_GET["oid"]);
$editobj = get_event_obj($oid);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title></title>
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/jquery.form.js"></script>
	<script type="text/javascript" src="js/jquery.validate.js"></script>
	<script type="text/javascript" src="js/jquery.validate.methods.js"></script>
	<script type="text/javascript" src="js/lang/zh-cn.js"></script>
	<script type="text/javascript" src="js/datepicker.js"></script>
	<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
	<script type="text/javascript" src="js/jquery.powerfloat.js"></script>
	<link rel="stylesheet" type="text/css" href="css/jquery.powerfloat.css" />
	<link rel="stylesheet" type="text/css" href="css/base.css" />
	<script type="text/javascript">
	
		$(function(){

			$("#contentform").validate({
				rules: {
					event_year:"required",
					event_content:"required"
				},
				messages: {
                    event_year:" 请填写大事记年份!",
                    glory_content:"请填写大事记内容"
				},
				submitHandler: function(form) {
					CKEDITOR.instances["event_content"].updateElement();
					$("#contentSubmit").attr({'disabled':'disabled'});
					$("#contentform").ajaxSubmit({
						success:function(data){
							parent.parent.maincenter.location = 'event_list.php';
							parent.parent.show_alert(data);
							parent.parent.close_dialog("EVENTEDIT");
                            parent.parent.location.reload();

						}
					});
					return false;
				}
			});

		});
	</script>
</head>
<body>
<div id="content_form">
	<form id="contentform" name="contentform" action="action/eventAction.php" method="post">
		<table width="750" border="0" cellpadding="0" cellspacing="0" align="left">
			<tr>
				<td height="35" colspan="2" style="padding-left:34px">
					<span><strong>注:</strong>带<span class="warninfo">*</span>的为必填项目!</span>
					<input type="hidden" name="oid" value="<?php echo $oid;?>" id="oid"/>
					<input type="hidden" name="useraction" value="EVENTEDIT" id="useraction"/>
				</td>
			</tr>
			<tr><td height="25" colspan="2" style="padding-left:34px"><div id="state_div"></div></td></tr>
			<tr>
				<td width="100" align="right" valign="middle" height="35"><span class="warninfo">*</span>&nbsp;大事记年份:</td>
				<td class="pleft" align="left" valign="middle"><input type="text" name="event_year" id="glory_year" value="<?php echo $editobj["year"];?>" class="no-animation disable-drag"/></td>
			</tr>
			<tr>
				<td width="100" align="right" valign="top" height="35" class="ptop" style="padding-top: 7px;"><span class="warninfo">*</span>&nbsp;大事记内容:</td>
				<td class="pleft" align="left" valign="middle" style="padding-top: 7px;">
					<textarea cols="10" id="event_content" name="event_content" rows="10"><?php echo $editobj["content"];?></textarea>
					<script type="text/javascript">
						CKEDITOR.replace("event_content",{height:"250px",width:'500px'});
					</script>
				</td>
			</tr>
			<tr>
				<td height="35">&nbsp;</td>
				<td class="pleft"><input type="submit" name="contentSubmit" id="contentSubmit" value="提交" /></td>
			</tr>
		</table>
	</form>
</div>
</body>
</html>